﻿create database Student
on
(
	name='Student',
	filename='D:\Student.mdf',
	size=6MB,
	maxsize=100MB,
	filegrowth=10MB
)
log on
(
	name='Student_log',
	filename='D:\Student_log.ldf',
	size=6MB,
	maxsize=50MB,
	filegrowth=10MB
)
go
use Student
go

create table StuInfo
(
	StuID int primary key identity(1,1),
	StuNum varchar(10) not null,
	StuName nvarchar(20)not null,
	StuSex char(2) default('男') check(StuSex='男' or StuSex='女') not  null,
	StuPhone int 
)
create table ClassInfo
(
	ClassID int primary key identity(1,1),
	ClassNum varchar(15) not null,
	ClassName nvarchar(30) not null,
	ClassRemark ntext not null,
	StuID int 
)
